package com.handsome.装饰者模式;

import com.handsome.装饰者模式.装饰者类.Chocolate;
import com.handsome.装饰者模式.装饰者类.Milk;

/**
 * @author niechun
 * @date 2023/2/27 20:40
 */
public class CoffeeBar {
    public static void main(String[] args) {
        //点一份单品咖啡
        Drink order=new LongBackCoffee();
        System.out.println("费用1："+order.cost());
        System.out.println("描述1："+order.getDescription());
        //加入一份牛奶
        order=new Milk(order);
        System.out.println("费用2："+order.cost());
        System.out.println("描述2："+order.getDescription());
        //加入一份牛奶
        order=new Milk(order);
        System.out.println("费用2："+order.cost());
        System.out.println("描述2："+order.getDescription());
        //加入一份牛奶
        order=new Milk(order);
        System.out.println("费用2："+order.cost());
        System.out.println("描述2："+order.getDescription());
        //加入一份巧克力
        order=new Chocolate(order);
        System.out.println("费用2："+order.cost());
        System.out.println("描述2："+order.getDescription());
    }
}
